package com.itfitness.exceptiondemo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    static {
        System.loadLibrary("native-lib");
    }
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        try {
            //在Java层中捕捉Native层抛出的异常
            callNativeException();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    /**
     * Native层的有异常的方法
     * @return
     */
    public native void callNativeException();
}
